package functions 
{	import functions.FunctionNode;	/**
	 * @author admin
	 */
	public class EllipseFunctionNode extends FunctionNode 
	{
		public function EllipseFunctionNode()
		{
			funcname = "ellipse";
			functiontype = FUNCTION;	
		}
		
		override public function getValue( args:XML, scope:Object ) : XML
		{
			var returnXML:XML;
			
			var literals:Array = new Array();
			
			for( var i : int = 0;i < 4; i++)
			{
				literals.push( Evaluator.getLiteral(Evaluator.evaluate(args.children()[ i ], scope)) );
			}
			
			trace("literals = " + literals); 
			
			Evaluator.getInstance().graphics.beginFill( args.children()[4], 100 );
			Evaluator.getInstance()["graphics"]["drawEllipse"].apply( Evaluator.getInstance().graphics, literals ); 
			Evaluator.getInstance().graphics.endFill( );

			 
			return returnXML;		
		}	}}